<?php
namespace app\common\model;

class WorkerBankToday extends Base
{
    protected $name = 'worker_bank_today';

    public function getFaceImgAttr($val)
    {
        if(!$val){
            return '';
        }

        return config('app.url') . $val;
    }

    /** 今日人工列表 */
    public function getWorkerBandTodayList($where = [], $page = 1, $limit = 10)
    {
        $list =  self::where($where)
            ->alias('worker_today')
            ->join('worker_bank worker','worker_today.worker_bank_id = worker.id')
            ->field('worker_today.id, worker.name, worker.face_img, worker.mobile, worker.card_id, worker_today.price')
            ->order('worker_today.create_time')
            ->page($page, $limit)
            ->select();

        return $list;
    }
}